package com.yuyou.fn.tradingservice.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.platform.entity.SysUser;
import com.yuyou.fn.tradingservice.entity.ServiceOrder;
import com.yuyou.fn.tradingservice.entity.ServiceOrderItem;
import com.yuyou.fn.tradingservice.vo.ServiceOrderItemQueryVo;
import com.yuyou.fn.tradingservice.vo.ServiceOrderItemResultVo;
import com.yuyou.fn.tradingservice.vo.ServiceOrderItemVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *
 * ServiceOrderItem 表数据服务层接口
 *
 */
public interface IServiceOrderItemService extends ISuperService<ServiceOrderItem,Long> {

    List<ServiceOrderItem>  findByLessCreateTimeAndStatus(Date date, Integer chargingStatus);

    List<ServiceOrderItem>  findByLessRefundTimeAndStatus(Date date, Integer chargingStatus);

    List<ServiceOrderItem> findByLessUpdateTimeAndGoodState(Date date, Integer goodState);


    List<ServiceOrderItem> findByOrderIdAndChargingStatus(Long orderId,Integer chargingStatus);

    void cancelServiceOrderItem(Long orderItemId, Integer orderStatus);


    void payServiceOrderItem(Long orderItemId,BigDecimal paidAmount,Integer payWay);

    void applyRefund(Long orderItemId,SysUser user,Integer chargingStatus,String refundReasonTag,String refundReason);

    void dealRefund(Long orderItemId,SysUser user,Integer status);

    Page<ServiceOrderItem> findByQueryCond(ServiceOrderItemQueryVo serviceOrderItemQueryVo,Integer pageNo,Integer pageSize);

    Page<ServiceOrderItemResultVo> fillByItemPage(Page<ServiceOrderItem> serviceOrderItemPage);

    ServiceOrderItem findByItemId(Long orderItemId);

    Long countUnFinishOrderItem(Long orderId,List<Integer> chargingStatusList);

    ServiceOrderItem changeStatusById(Long serviceOrderItemId,Integer status);

    ServiceOrderItem changeGoodStateById(Long serviceOrderItemId, Integer goodState);


    ServiceOrderItem changeIsCommentsById(Long serviceOrderItemId,Integer isComments);



    List<ServiceOrderItem> findOrderItemListByOrderId(Long orderId);

    ServiceOrderItemVo findOrderItemDetailById(Long orderItemId);

    /**
     * 根据orderItemId修改状态
     *
     * @param orderItemId
     * @param status
     */
    void changeOrderItemStatus(Long orderItemId,Integer status);

    void orderItemStatus(Long orderId);

    void sendGoods(Long orderId);

    void tradeSuccess(Long orderId);

    List<Long> findRoomIds(Long busTeamId);

    void changeOrderItemStatusByIds(List<Long> orderItemIds,Integer status);

    void changeStatusByServiceOrder(ServiceOrder serviceOrder);

    List<ServiceOrderItem> findByProductIdAndStatusList(Long productId,List<Integer> statusList);

    Long countOrderNumByUserId(Long userId);

    Long countOrderNumByOrderId(Long orderId);

    BigDecimal countLeaseOneDayByOrderItemId(Long orderItemId,Date date);

}